package org.example.service.impl;

import org.example.vo.SecurityUser;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserDetailsService {
    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        SecurityUser securityUser= new SecurityUser();
        if(username==null || !username.equals(securityUser.getUsername())){
            throw new UsernameNotFoundException("该用户不存在");
        }
        return securityUser;
    }
}
